Get Balance
The Get Balance API fetches the balance amount of an onboarded bank, with detailed breakup of amount received, amount sent, currency code of transactions, net position and upcoming window for next round of transactions.
Method: POST
{{URL}}/jsonrpc
Headers
Name | Value |
---|---|
Content-Type | application/json |
Example
Payload Parameters
Parameter | Description |
---|---|
id Mandatory | String Unique ID for each request |
jsonrpc Mandatory | String JSON RPC VERSION - should be "2.0" |
method Mandatory | String Method Name - should be "VisaService.GetBalance" |
params Mandatory | Object |
api Mandatory | Object |
credential Mandatory | String API credential provided by NetXD |
signature Mandatory | String Signature of the digitally signed payload |
payload Mandatory | Object |
- cURL
- C#
- Go
- NodeJs
curl --location --globoff '{{URL}}/jsonrpc' \
--header 'Content-Type: application/json' \
--data '{"id":"1","jsonrpc":"2.0","method":"VisaService.GetBalance","params":{"api":{"credential":"Basic c3VwcG9ydCsxQG5ldHN5cy1pbmMuY29tOjM5ZDYxOGJkNTVmNzQ4ZGQ4ZWY4NWI5NWQxY2RlNDE5","signature":"{{signature}}"},"payload":{}}}'
var options = new RestClientOptions("{{URL}}/jsonrpc")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/json");
var body = @"{
" + "\n" +
@" ""id"": ""1"",
" + "\n" +
@" ""jsonrpc"": ""2.0"",
" + "\n" +
@" ""method"": ""VisaService.GetBalance"",
" + "\n" +
@" ""params"": {
" + "\n" +
@" ""api"": {
" + "\n" +
@" ""credential"": ""Basic c3VwcG9ydCsxQG5ldHN5cy1pbmMuY29tOjM5ZDYxOGJkNTVmNzQ4ZGQ4ZWY4NWI5NWQxY2RlNDE5"",
" + "\n" +
@" ""signature"": ""{{signature}}""
" + "\n" +
@" },
" + "\n" +
@" ""payload"": {}
" + "\n" +
@" }
" + "\n" +
@"}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "{{URL}}/jsonrpc"
method := "POST"
payload := strings.NewReader(`{`+"
"+`
"id": "1",`+"
"+`
"jsonrpc": "2.0",`+"
"+`
"method": "VisaService.GetBalance",`+"
"+`
"params": {`+"
"+`
"api": {`+"
"+`
"credential": "Basic c3VwcG9ydCsxQG5ldHN5cy1pbmMuY29tOjM5ZDYxOGJkNTVmNzQ4ZGQ4ZWY4NWI5NWQxY2RlNDE5",`+"
"+`
"signature": "{{signature}}"`+"
"+`
},`+"
"+`
"payload": {}`+"
"+`
}`+"
"+`
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var https = require('follow-redirects').https;
var fs = require('fs');
var options = {
'method': 'POST',
'hostname': '{{URL}}',
'path': '/jsonrpc',
'headers': {
'Content-Type': 'application/json'
},
'maxRedirects': 20
};
var req = https.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
var postData = JSON.stringify({
"id": "1",
"jsonrpc": "2.0",
"method": "VisaService.GetBalance",
"params": {
"api": {
"credential": "Basic c3VwcG9ydCsxQG5ldHN5cy1pbmMuY29tOjM5ZDYxOGJkNTVmNzQ4ZGQ4ZWY4NWI5NWQxY2RlNDE5",
"signature": "{{signature}}"
},
"payload": {}
}
});
req.write(postData);
req.end();
Body
{
"id": "1",
"jsonrpc": "2.0",
"method": "VisaService.GetBalance",
"params": {
"api": {
"credential": "Basic c3VwcG9ydCsxQG5ldHN5cy1pbmMuY29tOjM5ZDYxOGJkNTVmNzQ4ZGQ4ZWY4NWI5NWQxY2RlNDE5",
"signature": "{{signature}}"
},
"payload": {}
}
}
Response: 201
Response Parameters
Parameter | Description |
---|---|
jsonrpc | String JSON RPC VERSION - should be "2.0" |
result | Object |
netPosition | List |
asOfDate | String Net position as on particular date |
upcomingWindow | String Details of upcoming window |
netPosition | String Net position of balance |
bankFunds | String Funds of bank |
incomingAmount | String Amount received from inbound transactions |
outgoingAmount | String Amount received from outbound transactions |
currencyAlphaCode | String Currency code in three characters |
asOfDate | String Net position as on particular date |
upcomingWindow | String Details of upcoming window |
netPosition | String Net position of balance |
bankFunds | String Funds of bank |
incomingAmount | String Amount received from inbound transactions |
outgoingAmount | String Amount received from outbound transactions |
currencyAlphaCode | String Currency code in three characters |
asOfDate | String Net position as on particular date |
upcomingWindow | String Details of upcoming window |
netPosition | String Net position of balance |
bankFunds | String Funds of bank |
incomingAmount | String Amount received from inbound transactions |
outgoingAmount | String Amount received from outbound transactions |
currencyAlphaCode | String Currency code in three characters |
id | String Request Id |
{
"jsonrpc": "2.0",
"result": {
"netPosition": [
{
"asOfDate": "2022-02-16 13:06:45 GMT",
"upcomingWindow": "2022-02-16 14:00:00 GMT",
"netPosition": "0",
"bankFunds": "0.00",
"incomingAmount": "0",
"outgoingAmount": "0",
"currencyAlphaCode": "EUR"
},
{
"asOfDate": "2022-02-16 13:06:45 GMT",
"upcomingWindow": "2022-02-16 14:00:00 GMT",
"netPosition": "0",
"bankFunds": "0.00",
"incomingAmount": "0",
"outgoingAmount": "0",
"currencyAlphaCode": "GBP"
},
{
"asOfDate": "2022-02-16 13:06:45 GMT",
"upcomingWindow": "2022-02-16 14:00:00 GMT",
"netPosition": "0",
"bankFunds": "0.00",
"incomingAmount": "0",
"outgoingAmount": "0",
"currencyAlphaCode": "USD"
}
]
},
"id": "1"
}